package edu.arizona.sista.learn.model;


/**
 * A simple model for a 'parameterized' duration interval, where the
 * interval is tied to some object
 * 
 * @author Anh Tran
 *
 * @param <ObjType> Type of the thing that's related to this interval.
 */
public class ParamInterval<ObjType> implements Comparable<ParamInterval<ObjType>> {
	
	private Interval _interval;
	private ObjType _obj = null;
	
	public ParamInterval(int start, int end, ObjType obj) {
		_interval = new Interval(start, end);
		_obj = obj;
	}
	
	public Interval interval() {
		return _interval;
	}
	
	public ObjType obj() {
		return _obj;
	}
	
	@Override
	public String toString() {
		return interval().toString() + " : " + _obj.toString();
	}

	@Override
	public int compareTo(ParamInterval<ObjType> o) {
		return this.interval().compareTo(o.interval());
	}
	
}
